xportethse 2.2.1
Loading...
Searching...
No Matches
xportethse


XPort ETH SE Click

XPort ETH SE Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.


Click Library

  • Author : Stefan Filipovic
  • Date : Jan 2025.
  • Type : UART type

Software Support

Example Description

This example demonstrates the use of the XPort ETH SE Click board for Ethernet communication. The application initializes the XPort ETH SE module, retrieves essential information such as firmware version, MAC address, and network status, and demonstrates sending a ping command. It also allows for bidirectional UART communication between the USB UART and the XPort ETH SE UART.

Example Libraries

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.XPortETHSE

Example Key Functions

Application Init

Initializes the UART communication, logs essential information, configures the XPort ETH SE module, and retrieves the firmware version, MAC address, and network status. It also demonstrates basic command operations such as pinging the specific IP address (8.8.8.8).

void application_init ( void )
{
log_cfg_t log_cfg;
xportethse_cfg_t xportethse_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
xportethse_cfg_setup( &xportethse_cfg );
if ( UART_ERROR == xportethse_init( &xportethse, &xportethse_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
log_printf( &logger, ">>> Reset Device to Monitor Mode <<<\r\n" );
xportethse_reset_device ( &xportethse );
xportethse_send_enter ( &xportethse );
xportethse_read_response ( &xportethse );
log_printf( &logger, "\r\n-----------------------------\r\n" );
log_printf( &logger, ">>> Query Firmware Version <<<\r\n" );
xportethse_read_response ( &xportethse );
log_printf( &logger, "\r\n-----------------------------\r\n" );
log_printf( &logger, ">>> Get MAC Address <<<\r\n" );
xportethse_read_response ( &xportethse );
log_printf( &logger, "\r\n-----------------------------\r\n" );
log_printf( &logger, ">>> Get Network Status and IP Address <<<\r\n" );
log_printf( &logger, ">>> Send QU Command to Exit Monitor Mode and Connect to Listed <<<\r\n" );
log_printf( &logger, ">>> IP Address Through Web Browser to Access Web Interface <<<\r\n" );
xportethse_read_response ( &xportethse );
log_printf( &logger, "\r\n-----------------------------\r\n" );
log_printf( &logger, ">>> Ping 8.8.8.8 and Switch to UART Terminal Commands Input <<<\r\n" );
xportethse_send_cmd ( &xportethse, XPORTETHSE_CMD_PING( "8.8.8.8" ) );
xportethse_send_enter ( &xportethse );
xportethse_read_response ( &xportethse );
}
#define XPORTETHSE_CMD_QUERY_FW_VERSION
Definition xportethse.h:123
#define XPORTETHSE_CMD_GET_MAC_ADDRESS
Definition xportethse.h:96
#define XPORTETHSE_CMD_MODE_MONITOR_WITH_NET
Definition xportethse.h:75
#define XPORTETHSE_CMD_PING(ADR)
Definition xportethse.h:99
#define XPORTETHSE_CMD_NET_STAT
Definition xportethse.h:98
#define XPORTETHSE_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition xportethse.h:161
void application_init(void)
Definition main.c:85
#define MIKROBUS_POSITION_XPORTETHSE
Definition main.c:41

Application Task

Continuously reads data from the USB UART and forwards it to the XPort ETH SE module, while also capturing responses from the module and forwarding them back to the USB UART. This allows real-time interaction with the device through the UART Terminal for configuration and diagnostics.

void application_task ( void )
{
app_buf_len = uart_read( &logger.uart, app_buf, PROCESS_BUFFER_SIZE );
if ( app_buf_len > 0 )
{
uart_write ( &xportethse.uart, app_buf, app_buf_len );
xportethse_clear_app_buf ( );
}
app_buf_len = uart_read( &xportethse.uart, app_buf, PROCESS_BUFFER_SIZE );
if ( app_buf_len > 0 )
{
uart_write ( &logger.uart, app_buf, app_buf_len );
xportethse_clear_app_buf ( );
}
}
void application_task(void)
Definition main.c:142
#define PROCESS_BUFFER_SIZE
Definition main.c:46

Note

Ensure the XPort ETH SE Click board is properly connected to the network.

Application Output

This Click board can be interfaced and monitored in two ways:

  • Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
  • UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.

Additional Notes and Information

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.